const mongoose = require('mongoose')
const Schema = mongoose.Schema

const UserType = {
    id: Number,
    username: String,
    name: String,
    password: String,
    sex: String,
    livecity: String 
}
const CityType = {
    cityId: Number,
    name: String,
    pinyin: String
}
const AttractionType = {
    name: String,
    pinying: String,
    citypinying: String,
    city: String,
    cityId: Number,
    location: String,
    lnglat: Object,
    picture: Array,
    story: String,
    comments: Array
}
const ExplorationType = {
    id: Number,
    username: String,
    title: String,
    userid: Number,
    picture: Array,
    centent: String,
    comments: Array
}

const ProjectModel = {
    UserModel : mongoose.model('user',new Schema(UserType)),
    CityModel : mongoose.model('city',new Schema(CityType)),
    AttractionModel : mongoose.model('attraction',new Schema(AttractionType)),
    ExplorationModel : mongoose.model('exploration',new Schema(ExplorationType))
}

module.exports = ProjectModel